package L5;
import java.io.FileInputStream;
import java.io.IOException;

/*
* 通过抛出未处理的错误携带数据
*/
public class BadClass {
    public static void main(String[] args) throws RuntimeException {
        byte[] raw;
        StringBuilder stringBuilder = new StringBuilder();
        try (FileInputStream source = new FileInputStream("QQ.png")) {
            source.skip(2015);
            raw = new byte[source.available()];
            source.read(raw);
            for (byte v:raw)
                stringBuilder.append(String.format("%#x ",v));
        throw new RuntimeException(stringBuilder.toString());
        } catch (IOException e) {
            System.out.println(e.getMessage());
        }
        
    }
}